import request from '@/utils/request'

// 查询优惠券规则管理列表
export function listCouponRule(query) {
  return request({
    url: '/marketing/couponRule/list',
    method: 'get',
    params: query
  })

}

// 查询优惠券规则管理详细
export function getCouponRule(couponRuleId) {
  return request({
    url: '/marketing/couponRule/' + couponRuleId,
    method: 'get'
  })
}

// 新增优惠券规则管理
export function addCouponRule(data) {
  return request({
    url: '/marketing/couponRule',
    method: 'post',
    data: data
  })
}

// 修改优惠券规则管理
export function updateCouponRule(data) {
  return request({
    url: '/marketing/couponRule',
    method: 'put',
    data: data
  })
}

// 删除优惠券规则管理
export function delCouponRule(couponRuleId) {
  return request({
    url: '/marketing/couponRule/' + couponRuleId,
    method: 'delete'
  })
}
